<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">

    <!-- INTERFACE -->
    <cc:interface >
        <cc:attribute name="autoUpdate" default="false" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation> 
        <div id="#{cc.attrs.clientId}" >
            <p:outputPanel autoUpdate="#{cc.attrs.autoUpdate}">
                <h:panelGroup rendered="#{not empty facesContext.messageList}">
                    <p:dialog showHeader="false" closable="false" modal="true" appendToBody="true"
                              onShow="$('button[id*=buttonConfirmMessage]').focus();"
                              id="xpertModalMessages"
                              styleClass="faces-modal-messages" resizable="false"
                              widgetVar="xpertModalDialogMessages" visible="true">
                        <div class="modal-messages">
                            <p:messages/>
                            <div align="center">
                                <p:commandButton rendered="#{primeFacesVersion.primeFaces3}"
                                                 onclick="xpertModalDialogMessages.hide();$('.faces-modal-messages').remove();$('div[id*=xpertModalMessages]').remove();" type="button" value="Ok" />
                               
                                <p:commandButton rendered="#{not primeFacesVersion.primeFaces3}"
                                                 onclick="PF('xpertModalDialogMessages').hide();$('.faces-modal-messages').remove();$('div[id*=xpertModalMessages]').remove();" type="button" value="Ok" />
                            </div>
                        </div>
                    </p:dialog>
                </h:panelGroup>
            </p:outputPanel>
        </div>
    </cc:implementation>
</html>